<?php
class Pageley_Query_Condition_In extends Pageley_Query_Condition_Single {
	private $values;
	private $queryValues;
	private $sql;
	
	public function __construct($propertyName, $values) {
		parent::__construct($propertyName, null);
		$this->values = $values;
	}
	
	public function setQuery($query) {
		$this->queryValues = new Pageley_Util_ArrayMap();
		foreach($this->values as $value) {
			$key = $propertyName . $query->getNextIndex($this->getPropertyName());
			$this->queryValues->put($key, $value);
		}
	}
	
	public function matches($entity) {
		return $this->values->containsValue($entity->get($this->getPropertyName()));
	}
	
	public function getOperator() {
		return "in";
	}
	
	public function getValues() {
		return $this->queryValues;
	}
}